#if defined (TEST_PLUGIN) && (TEST_PLUGIN == 1)

#include <iostream>
#include <string>
#include <windows.h>
#include <examples/unityplugin/unity_plugin_apis.h>

static void on_local_sdp_created(const char* type, const char* sdp);

int main(int argc, char* argv[]) {
        std::string str {"hello world!"};
        int pcid = CreatePeerConnection(nullptr, 0, "", "", false);
        if (pcid == -1)  goto cleanup;

        RegisterOnLocalSdpReadytoSend(pcid, on_local_sdp_created);

        bool ret = false;
        ret = AddStream(pcid, false);        
                if (!ret) goto cleanup;
                
        ret = CreateOffer(pcid);
                if (!ret) goto cleanup;

        Sleep(15 * 1000);
cleanup:
        if (pcid != -1) {
                ClosePeerConnection(pcid);
        }
        return 0;
}

void on_local_sdp_created(const char* type, const char* sdp) {
        std::cout << __func__ << std::endl;
        std::cout << "type: " << type << std::endl;
        std::cout << "sdp: " << sdp << std::endl;
}

#endif